import request from '@/utils/request'

// 查询商户列表
export function listUser(query) {
    return request({
        url: '/tenant/user/list',
        method: 'get',
        params: query
    })
}

export function listUsers(query) {
    return request({
        url: '/tenant/user/lists',
        method: 'get',
        params: query
    })
}



export function logincode(id) {
    return request({
        url: '/tenant/user/logincode/' + id,
        method: 'get',
    })
}


// 查询商户详细
export function getUser(id) {
    return request({
        url: '/tenant/user/' + id,
        method: 'get'
    })
}

// 新增商户
export function addUser(data) {
    return request({
        url: '/tenant/user',
        method: 'post',
        data: data
    })
}

// 修改商户
export function updateUser(data) {
    return request({
        url: '/tenant/user',
        method: 'put',
        data: data
    })
}

// 删除商户
export function delUser(id) {
    return request({
        url: '/tenant/user/' + id,
        method: 'delete'
    })
}


// 商户密码重置

export function resetPwd(id, password) {
    const data = {
        id,
        commercialPassword: password
    }
    return request({
        url: '/tenant/user/resetPwd',
        method: 'put',
        data: data
    })
}